package logic

import (
	"context"
	"videos/video-rpc/proto/video"
	"videos/video-service/server"
)

type VideoServer struct {
	video.UnimplementedVideoServer
}

func (VideoServer) UserRegister(ctx context.Context, in *video.UserRegisterReq) (*video.UserRegisterResp, error) {
	register, err := server.UserRegister(in)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (VideoServer) UserLogin(ctx context.Context, in *video.UserLoginReq) (*video.UserLoginResp, error) {
	login, err := server.UserLogin(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (VideoServer) VideoList(ctx context.Context, in *video.VideoListReq) (*video.VideoListResp, error) {
	list, err := server.VideoList(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (VideoServer) VideoCreate(ctx context.Context, in *video.VideoCreateReq) (*video.VideoCreateResp, error) {
	list, err := server.VideoCreate(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (VideoServer) VideoSO(ctx context.Context, in *video.VideoSOReq) (*video.VideoListResp, error) {
	list, err := server.VideoSO(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (VideoServer) VideoUpdate(ctx context.Context, in *video.VideoUpdateReq) (*video.VideoUpdateResp, error) {
	list, err := server.VideoUpdate(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (VideoServer) VideoDel(ctx context.Context, in *video.VideoDelReq) (*video.VideoDelResp, error) {
	del, err := server.VideoDel(in)
	if err != nil {
		return nil, err
	}
	return del, nil
}
